Skip to content

Fix discovery external docs URL#309

Merged
meowsbits merged 2 commits intomasterfrom
fix/discovery-externaldocs-url
Jan 20, 2021
Merged

Fix discovery external docs URL#309
meowsbits merged 2 commits intomasterfrom
fix/discovery-externaldocs-url

Conversation

@ziogaschr
Copy link
Copy Markdown
Member

@ziogaschr ziogaschr commented Jan 20, 2021

The RPC discovery document was returning links to GitHub repo of ethereum/go-ethereum. This PR makes those links, link back to our etclabscore/core-geth repo.

On top of that, this PR also adds link to our documentation site for the whole discovery document. This link has to be updated to the final page made available by #306.

Fixes #297

Comment thread node/openrpc.go
@ziogaschr ziogaschr force-pushed the fix/discovery-externaldocs-url branch from 26da9ed to 735fd88 Compare January 20, 2021 15:15
Copy link
Copy Markdown
Contributor

@meowsbits meowsbits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Example snippet provided as generated locally:

{
  "openrpc": "1.2.6", 
  "info": {
    "title": "Core-Geth RPC API", 
    "version": "1.11.22-unstable/generated-at:2021-01-20T15:07:56-06:00"
  }, 
  "externalDocs": {
    "description": "ETC Labs Documentation", 
    "url": "https://etclabscore.github.io/core-geth/"
  }, 
  "servers": [
    {
      "url": "ws://127.0.0.1:8546", 
      "name": "tcp"
    }
  ], 
  "methods": [
    {
      "name": "admin_addPeer", 
      "description": "```go\nfunc (api *privateAdminAPI) AddPeer(url string) (bool, error) {\n\tserver := api.node.Server()\n\tif server == nil {\n\t\treturn false, ErrNodeStopped\n\t}\n\tnode, err := enode.Parse(enode.ValidSchemes, url)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"invalid enode: %v\", err)\n\t}\n\tserver.AddPeer(node)\n\treturn true, nil\n}// AddPeer requests connecting to a remote node, and also maintaining the new\n// connection at all times, even reconnecting if it is lost.\n\n```", 
      "summary": "AddPeer requests connecting to a remote node, and also maintaining the new\nconnection at all times, even reconnecting if it is lost.\n", 
      "paramStructure": "by-position", 
      "params": [
        {
          "name": "url", 
          "description": "string", 
          "summary": "", 
          "schema": {
            "type": ["string"]
          }, 
          "required": true, 
          "deprecated": false
        }
      ], 
      "result": {
        "name": "bool", 
        "description": "bool", 
        "summary": "", 
        "schema": {
          "type": ["boolean"]
        }, 
        "required": true, 
        "deprecated": false
      }, 
      "deprecated": false, 
      "externalDocs": {
        "description": "Github remote link", 
        "url": "https://github.com/etclabscore/core-geth/blob/master/node/api.go#L65"
      }
    }, 

@meowsbits meowsbits merged commit c3a0b59 into master Jan 20, 2021
@meowsbits meowsbits deleted the fix/discovery-externaldocs-url branch January 20, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rpc: discovery to return correct link for methods' externalDocs

2 participants